package org.btik.redstone.led.listener;

import org.bukkit.block.Block;

import java.util.Objects;

public class BlockKey {
    private final int x;
    private final int y;
    private final int z;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BlockKey blockKey = (BlockKey) o;
        return x == blockKey.x && y == blockKey.y && z == blockKey.z;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y, z);
    }

    public BlockKey(Block block) {
        this.x = block.getX();
        this.y = block.getY();
        this.z = block.getZ();
    }
}
